/**
 * 定义暴露给渲染进程的API类型
 */
export interface ElectronAPI {
  // 照片相关API
  photos: {
    getList: (params: {
      page?: number
      limit?: number
      orderBy?: string
      orderDirection?: 'ASC' | 'DESC'
      filters?: any
    }) => Promise<any>
    getById: (params: { id: number }) => Promise<any>
    update: (params: { id: number; updates: any }) => Promise<any>
    delete: (params: { id: number }) => Promise<any>
    deleteMultiple: (params: { ids: number[] }) => Promise<any>
    updateMultiple: (params: { ids: number[]; updates: any }) => Promise<any>
    getThumbnail: (params: { id: number }) => Promise<any>
  }
  
  // 相册相关API
  albums: {
    getList: (params: {
      page?: number
      limit?: number
      orderBy?: string
      orderDirection?: 'ASC' | 'DESC'
    }) => Promise<any>
    getById: (params: { id: number }) => Promise<any>
    create: (params: { name: string; description?: string }) => Promise<any>
    update: (params: { id: number; updates: any }) => Promise<any>
    delete: (params: { id: number }) => Promise<any>
    addPhoto: (params: { albumId: number; photoId: number }) => Promise<any>
    removePhoto: (params: { albumId: number; photoId: number }) => Promise<any>
  }
  
  // 搜索相关API
  search: {
    query: (params: {
      query?: string
      filters?: any
      page?: number
      limit?: number
    }) => Promise<any>
    photos: (params: {
      query?: string
      page?: number
      pageSize?: number
      filters?: any
    }) => Promise<any>
    albums: (params: {
      query?: string
      page?: number
      pageSize?: number
    }) => Promise<any>
    tags: (params: {
      query?: string
      page?: number
      pageSize?: number
    }) => Promise<any>
    getSuggestions: (params: { type: string; query: string }) => Promise<any>
    getPopularTags: (params?: { limit?: number }) => Promise<any>
    getAllTags: () => Promise<any>
    getCameraMakes: () => Promise<any>
    getCameraModels: (params?: { make?: string }) => Promise<any>
  }
  
  // 系统相关API
  system: {
    openFile: (params: { filePath: string }) => Promise<any>
    showInFolder: (params: { filePath: string }) => Promise<any>
    getAppVersion: () => Promise<any>
    checkForUpdates: () => Promise<any>
    selectFolder: () => Promise<any>
    selectFile: (params?: { filters?: any[]; multiple?: boolean }) => Promise<any>
    getUserDataPath: () => Promise<any>
    getTempPath: () => Promise<any>
    getDocumentsPath: () => Promise<any>
    getPicturesPath: () => Promise<any>
    showMessageBox: (params: {
      type?: 'none' | 'info' | 'error' | 'question' | 'warning'
      title: string
      message: string
      buttons?: string[]
    }) => Promise<any>
  }
  
  // 事件监听
  on: (channel: string, callback: (...args: any[]) => void) => void
  off: (channel: string, callback: (...args: any[]) => void) => void
}